package modele;

import modele.Badge;

public class Personne {
	
	private String nom;
	private String prenom;
	private String ID;
	private String type;
	private static int num=0;
	private Badge badge;
	
	public Personne(String nom, String prenom, String ID, Badge badge) {
		super();
		this.setNom(nom);
		this.setPrenom(prenom);
		this.setID(ID);
		this.setBadge(badge);
	}
	public Personne(String nom, String prenom, Badge badge) {
		super();
		this.setNom(nom);
		this.setPrenom(prenom);
		this.setID(this.genereID());
		this.setBadge(badge);
	}
	
	public Personne(String nom, String prenom, String ID) {
		super();
		this.setNom(nom);
		this.setPrenom(prenom);
		this.setID(ID);
	}
	public String getNom() {
		return nom;
	}
	public void setNom(String nom) {
		this.nom = nom;
	}
	public String getPrenom() {
		return prenom;
	}
	public void setPrenom(String prenom) {
		this.prenom = prenom;
	}
	public String getID() {
		return ID;
	}
	public void setID(String ID) {
		this.ID = ID;
	}
	public Badge getBadge() {
		return badge;
	}
	public void setBadge(Badge badge) {
		this.badge = badge;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public String toString()
	{
		return this.nom + " " + this.prenom + " " + this.ID +"\nDroit d'acces : \n" +this.badge;
	}
	private String genereID()
	{
		int nb = ++Personne.num;
		return this.nom+this.prenom+nb;
	}
}
